<template>
  <tool-page title="生成随机车牌号" :value="plate" @generate="onClick">
    <template #buttonBefore>
      <div>
        区域：
        <i-select v-model="area" style="width:200px">
          <i-option v-for="(item, index) in plateAreas" :value="item" :key="index">{{ item }}</i-option>
        </i-select>
      </div>
    </template>
  </tool-page>
</template>

<script>

export default {
  name: "RandPlate",
  data() {
    return {
      plate: '',
      plateAreas: '',
      area: ''
    }
  },
  methods: {
    onClick() {
      this.plate = this.simpleUtils.randomPlate(this.area);
    },
    copy() {
      this.simpleUtils.copy(this.phone);
    }
  },
  created() {
    this.plateAreas = this.simpleUtils.root.PLATE_AREA_LIST;
    this.plate = this.simpleUtils.randomPlate();
  }
}
</script>

<style lang="scss" scoped>
</style>
